/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package adapter;

/**
 *
 * @author jccaicedo
 */
public class AdapterPromedio extends OperacionesEstadisticas {

    private Promedio promedio;

    public AdapterPromedio(){
        promedio = new Promedio();
    }

    @Override
    public void setData(int[] datos) {
        double[] d = new double[datos.length];
        for(int i = 0; i < datos.length; i++){
            d[i] = (double)datos[i];
        }
        promedio.setDatos(d);
    }

    @Override
    public double calcularOperacion() {
        double r = promedio.promediar();
        return r;
    }

}
